import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      redirect: '/home',
      meta: {
        title: '首页',
      },
    },
    {
      path: '/home',
      name: 'home',
      component: (resolve) => {
        require(['../pages/home'], resolve)
      },
      meta: {
        title: '首页',
        isLogin: true,
      },
    },
    {
      path: '/cert',
      name: 'cert',
      component: (resolve) => {
        require(['../pages/cert'], resolve)
      },
      meta: {
        title: '证书',
        isLogin: true,
      },
    },
    {
      path: '/apply',
      name: 'apply',
      component: (resolve) => {
        require(['../pages/apply'], resolve)
      },
      meta: {
        title: '报名',
        isLogin: true,
      },
    },
    {
      path: '/answer',
      name: 'answer',
      component: (resolve) => {
        require(['../pages/answer'], resolve)
      },
      meta: {
        title: '答题',
        isLogin: true,
      },
    },
  ],
})
